using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class 新手引导View : BaseWindow
{
    [SerializeField] private GameObject 挖洞;
    [SerializeField] private RectTransform 填洞上;
    [SerializeField] private RectTransform 填洞下;
    [SerializeField] private RectTransform 填洞左;
    [SerializeField] private RectTransform 填洞右;
    [SerializeField] private RectTransform rect洞;
    [SerializeField] private List<RectTransform> 填洞大小;

    public void 开始挖洞(填洞Type type)
    {
        挖洞.gameObject.SetActive(true);        
        
        int index = type.GetHashCode();
        rect洞.position = 填洞大小[index].position;
        rect洞.sizeDelta = 填洞大小[index].sizeDelta;
        float 上h = Screen.height / 2f - rect洞.anchoredPosition.y - rect洞.sizeDelta.y / 2f;
        float 下h = Screen.height / 2f + rect洞.anchoredPosition.y - rect洞.sizeDelta.y / 2f;
        float 左w = Screen.width / 2f + rect洞.anchoredPosition.x - rect洞.sizeDelta.x / 2f;
        float 右w = Screen.width / 2f - rect洞.anchoredPosition.x - rect洞.sizeDelta.x / 2f;
        填洞上.sizeDelta = new Vector2(0, 上h);
        填洞下.sizeDelta = new Vector2(0, 下h);
        填洞左.sizeDelta = new Vector2(左w, 0);
        填洞右.sizeDelta = new Vector2(右w, 0);
    }

    public void 停止挖洞()
    {
        挖洞.gameObject.SetActive(false);   
        CloseWindow();
    }
}

public enum 填洞Type
{
    点击主角,
}
